//
//  TNewTaskCell.m
//  iTimeline
//
//  Created by Mobioneer HV 02 on 1/14/13.
//  Copyright (c) 2013 Mobioneer Co., Ltd. All rights reserved.
//

#import "TNewTaskCell.h"

@implementation TNewTaskCell
@synthesize btnBlue = _btnBlue;
@synthesize btnGreen = _btnGreen;
@synthesize btnRed = _btnRed;
- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        // Initialization code
    }
    return self;
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated
{
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}
-(UIImage*)getImageX:(int)id
{
    if(id==1) return [UIImage imageNamed:@"green-tick.png"];
    if(id==2) return [UIImage imageNamed:@"blue-tick.png"];
    if(id==3) return [UIImage imageNamed:@"red-tick.png"];
    return nil;
    
}
-(UIImage*)setImageX:(int)id
{
    if(id==1) return [UIImage imageNamed:@"green.png"];
    if(id==2) return [UIImage imageNamed:@"blue.png"];
    if(id==3) return [UIImage imageNamed:@"red.png"];
    return nil;
    
}
- (IBAction)btnGreen:(id)sender {
    [self.btnBlue setImage:[self setImageX:2] forState:UIControlStateNormal];
    [self.btnRed setImage:[self setImageX:3] forState:UIControlStateNormal];
    [self.btnGreen setImage:[self getImageX:1] forState:UIControlStateNormal];
    [self.delegate setPriority:1];
}

- (IBAction)btnBlue:(id)sender {
    [self.btnGreen setImage:[self setImageX:1] forState:UIControlStateNormal];
    [self.btnRed setImage:[self setImageX:3] forState:UIControlStateNormal];
    [self.btnBlue setImage:[self getImageX:2] forState:UIControlStateNormal];
    [self.delegate setPriority:2];
}

- (IBAction)btnRed:(id)sender {
    [self.btnBlue setImage:[self setImageX:2] forState:UIControlStateNormal];
    [self.btnGreen setImage:[self setImageX:1] forState:UIControlStateNormal];
    [self.btnRed setImage:[self getImageX:3] forState:UIControlStateNormal];
    [self.delegate setPriority:3];
}
@end
